package com.slliver.pay.openfeign;


import com.slliver.commonmodel.product.Product;
import com.slliver.pay.openfeign.fallback.ProductFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * 商品的远程调用openfeign客户端接口
 */
@FeignClient(value = "product-service", fallback = ProductFeignClientFallback.class) // 发送请求的客户端
public interface ProductFeignClient {

    @GetMapping("/api/product/{productId}")
    Product getProductById(@PathVariable("productId") Long productId, @RequestHeader("token") String token);
}
